package com.test.java;

import java.util.Scanner;

/**
 * 输入两个非负10进制整数A和B(<=230-1)，输出A+B的D (1 < D <= 10)进制数。
 * =============================================================
 * Version          Author          Date            Description
 * 1.0              白建         2017/12/21             创建
 * =============================================================
 */
public class Java_13
{

    public static void main(String[] args)
    {

        Scanner scanner = new Scanner(System.in);
        int A, B, D;

        A = scanner.nextInt();
        B = scanner.nextInt();
        D = scanner.nextInt();

        System.out.println(Integer.toString(A + B, D));
    }
}
